home *** CD-ROM | disk | FTP | other *** search
- >> If AGE<10
- >> Print "You are less than 10 years old."
- >> else if AGE=21
- >> Print "Hey!! Now you can drink alcohol in the U.S.!!"
- >> else
- >> Print "WOW, you're OVER 21!!"
- >> endif
- >> Well, problem is this won't work.
-
- > Yes it will. I tried it.
-
- Very strange as I just tried it as well and AMOS gives an error
- (missing End If) just as I suspected!! The only thing I can
- assume is that you and Keith are using AMOS Pro which must
- have changed things a bit. In AMOS v1.36 it will NOT work.
-
-
- > The logic is the same too. Select..is just
- > more advanced in that it offers some extra features.
-
- The logic is NOT the same. Look at the above code again. This
- will print "WOW, you're over 21!!" as long as AGE is greater than
- 9 and unequal to 21...
-
-
- >>If AGE<10
- >> Print "You are less than 10 years old."
- >>Else If AGE=21
- >> Print"Hey!! Now you can drink alcohol in the U.S.!!"
- >> Else If AGE>21
- >> Print "WOW, you'r OVER 21!!"
- >> End If
- >> End If
- >>End If
-
- > That would trigger the error-system. One if and three end-ifs is
- > plain wrong.
-
- Try it... it works fine. Look at the source, there ARE three Ifs.
- It's the only way you can do it in AMOS v1.36 to use the style
- you suggested.
-
-
- > That being said, this might be a bit clearer (arguably the "best"
- > method for AMOS) but it still lacks when compared to the
- > Select...Case style. Anyway, the point is you are still looking at
- > the same two basic methods, the If...End If and the If...Else...EndIf
-
- > Yes but does it really matter? The result is what is importand
- > and the if... else if... else end if... structure is quite close to
- > the select.. syntax.
-
- Of course not. Actually, I don't even know what we're debating
- here!! I was simply responding to the VB-guy's post about
- Select...Case. In the end, it doesn't matter to me: I'll use If...
- EndIf, If...Else...EndIf, as it's six one way and half a dozen the
- other, but the whole point of this thread was that it might be
- nice to have support for SELECT...CASE in AMOS. :-)
-
-
- Garfield Benjamin e-mail:gbenjam@sosbbs.com
- Website( http://www.sosbbs.com/~gbenjam ): 50% Complete
-
-